//
//  LePhysicsWorld.h
//  Leste
//
//  Created by 王乐 on 2022/1/25.
//

#ifndef LePhysicsWorld_hpp
#define LePhysicsWorld_hpp

#include <box2d/box2d.h>
#include "LeContactListener.h"

class LePhysicsWorld
{
public:
    LePhysicsWorld();
    ~LePhysicsWorld();
    
public:
    static void initPhysicsWorld()
    {
        world.SetContactListener(pcontactlistener);
    }
    
    static void Step()
    {
        world.Step(timeStep, velocityIterations, positionIterations);
    }
    
public:
    static b2World world;
    static LeContactListener* pcontactlistener;
    
private:
    static float timeStep;
    static int32 velocityIterations;
    static int32 positionIterations;
};

#endif /* LePhysicsWorld_hpp */
